<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">

    <ui:define name="body">

        <h:messages globalOnly="true" styleClass="message"/>

        <h:form id="programGoalForm">

            <rich:panel>
                <f:facet name="header">#{messages['programgoal']}</f:facet>
                <s:decorate id="numberDecoration" template="layout/display.xhtml">
                    <ui:define name="label">#{messages['number']}</ui:define>
                    #{programGoalHome.instance.number}
                </s:decorate>
                <s:decorate id="descriptionDecoration" template="layout/display.xhtml">
                    <ui:define name="label">#{messages['programgoal.description']}</ui:define>
                    #{programGoalHome.instance.description}
                </s:decorate>
                <s:decorate id="languageDecoration" template="layout/display.xhtml">
                    <ui:define name="label">#{messages['programgoal.language']}</ui:define>
                    #{programGoalHome.instance.language.name}
                </s:decorate>

                <div style="clear:both"/>

            </rich:panel>

            <div class="actionButtons">
                <s:button view="/programGoalEdit.xhtml"
                          id="edit"
                          value="#{messages['button.edit']}"/>
                <s:button view="/#{empty programGoalFrom ? 'programGoalList' : programGoalFrom}.xhtml"
                          id="done"
                          value="#{messages['button.done']}"/>
                <s:button id="addLearningOutcome"
                          value="#{messages['programgoal.addlearningoutcome']}"
                          view="/learningOutcomeEdit.xhtml"
                          propagation="none"
                          rendered="#{programGoalHome.wired}">
                    <f:param name="programGoalId"
                             value="#{programGoalHome.instance.id}"/>
                    <f:param name="learningOutcomeFrom" value="ProgramGoal"/>
                </s:button>
            </div>

        </h:form>
        <rich:panel>
            <f:facet name="header">#{messages['learningoutcomes']}</f:facet>
            <rich:dataTable value="#{programGoalHome.learningOutcomes}" var="learningOutcome"
                            rendered="#{not empty programGoalHome.learningOutcomes}"
                            rowClasses="rvgRowOne,rvgRowTwo"
                            id ="learningOutcomesTable">
                <h:column>
                    <f:facet name="header">#{messages['number']}</f:facet>

                    <s:link view="/learningOutcome.xhtml"
                            id="selectLearningOutcome"
                            value="#{learningOutcome.number}"
                            propagation="none">
                        <f:param name="learningOutcomeId"
                                 value="#{learningOutcome.id}"/>
                        <f:param name="learningOutcomeFrom" value="programGoal"/>
                    </s:link>
                </h:column>
                <h:column>
                    <f:facet name="header">#{messages['learningoutcome.description']}</f:facet>
                    #{learningOutcome.description}
                </h:column>
                <h:column>
                    <f:facet name="header">#{messages['learningoutcome.assessement']}</f:facet>
                    #{learningOutcome.assessementTool}
                </h:column>
                <h:column>
                    <f:facet name="header">#{messages['learningoutcome.schedule']}</f:facet>
                    #{learningOutcome.timeSchedule}
                </h:column>
            </rich:dataTable>
        </rich:panel>
    </ui:define>

</ui:composition>

